import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { GoodsListComponent } from './goods-list/goods-list.component';
import { GoodsTypeListComponent } from './goods-type-list/goods-type-list.component';
import { GoodsEditComponent } from './goods-list/goods-edit/goods-edit.component';
import { CanDeactivateGuard } from '@core/guards-activate/can-deactivate-guard.activate';
import { GoodsAddComponent } from './goods-list/goods-add/goods-add.component';
import { GoodsSortComponent } from './goods-sort/goods-sort.component';

const routes: Routes = [

  { path: 'list', component: GoodsListComponent },
  { path: 'list/edit', component: GoodsEditComponent,canDeactivate: [CanDeactivateGuard], },
  { path: 'list/add', component: GoodsAddComponent,canDeactivate: [CanDeactivateGuard], },
  { path: 'type-list', component: GoodsTypeListComponent },
  { path: 'goods-sort', component: GoodsSortComponent }];

@NgModule({
  imports: [RouterModule.forChild(routes)],
  exports: [RouterModule]
})
export class GoodsRoutingModule { }
